<?php
    $id = request('id',false,true);
    $pid = request('pid',false,true,false,82);
    require_once $_site->get_handlepath('info');
    $title="品牌快讯";
    $catinfo = info_fun_info_cat_list(array('pid'=>99));
    $page = request('page',false,true,false,1);
    $pagesize = request('pagesize',false,true,false,15);


    $type = request('type',false,true,false,1);
    $hover[$type] = "class='hover'";
    
    if(!$id){
        $join_trend = info_fun_info_list(array('cid'=>$pid,'hidden_flag'=>0,'cat'=>1),$page,$pagesize);
        $urlparam = "/wap/news&type=$type&pid={$pid}";
        $pagination = "<span><font style='color:red'>$page</font>/{$join_trend['page_count']}</span>".page_method($join_trend['row_count'],$page,$join_trend['page_count'],0,$urlparam,false);
        if(count($join_trend['rows'])==1){        	
            location("/wap/news&id={$join_trend['rows'][0]['id']}&pid={$pid}&type=$type");
        }
    }else{
        $content = info_fun_get_info_by_id($id);
    }
    $cat = info_fun_get_cat_by_id($pid);

    $type = request('type',false,true,false,1);
    $typeval=array(1=>array('pid'=>170,"title"=>'连锁流程'),2=>array('pid'=>171,"title"=>'连锁优势'),3=>array('pid'=>172,"title"=>'连锁支持'));
    $hover[$type] = "class='hover'";

?>
<?php require_once $_site->get_viewpath("wap/commom/head");?>

<body>
<div class="tittle">
      <a href="javascript:window.history.go(-1);" class="arrow_carrot-left return"></a>
	  <?php echo $title?>
	  <a href="/wap/index" class="icon_house house" style="vertical-align:middle;"></a>
</div>
<div class="nav" style="display:none;"><a class="hover" href="#">公司公告</a><a href="#">行业新闻</a><a href="#">企业新闻</a></div>
<div class="newspage">
	<div class="newspage_top"  style="display:none;"><span>品牌快讯</span></div>
    <div class="news_bottom" style="margin-top:20px;">
	
        <?php
            if($id){
                 echo "<center><strong>".$content['title']."</strong></center><br/>" ;
                    preg_match_all('/<\s*img\s+[^>]*?>/i',$content['content'],$matchs); //   提取出图片的正则 
                    if($matchs[0] && !empty($matchs[0])){
                        echo "<p style='float: left; width: 100%;'>";
                        foreach($matchs[0] as $val){
                            echo $val;
                        }
                        echo "</p>";
                    }
                    
					$str = $content['content']; 
                    echo htmlspecialchars_decode($str);
            }else{
            ?>
            <ul>
                <?php
                    if(is_array($join_trend['rows'])){
                        foreach ($join_trend['rows'] as $v){
                            echo"
                            <li>
                            <a href='/wap/news&id={$v['id']}&pid={$pid}&type=$type'>
                            <em class='icon_stop'></em>
                            ".subs($v['title'],20)."
                            </a>
                            </li>
                            ";
                        }
                    }else{
                        echo"<li class='no_info'>暂无加盟信息！</li>";
                    }
                ?>
            </ul>
            <div class="page">
                <?php echo $pagination ?>
            </div>
            <?php
            }
        ?>	
	
     </div>
</div>

    <?php require_once $_site->get_viewpath("wap/commom/bottom");?>
	
</body>
</html>
